// readonly的妙用
class Axios {
  readonly site: string = "https://www.houdunren.com/api"
  // 构造函数可以修改readonly
  public constructor(site?: string) {
    this.site = site || this.site
  }
  public get(url: string): any[] {
    console.log(`地址是${this.site}/${url}`);

    return []
  }
}

const instance = new Axios()
// instance.site = '111' //无法修改
instance.get('user')